package cn.adkii.middleware.whitelist.test.interfaces;

import cn.adkii.middleware.whitelist.annotation.DoWhiteList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {
    private Logger logger = LoggerFactory.getLogger(UserController.class);

    @DoWhiteList(key = "userId", returnJson="{\"code\":\"1111\",\"info\":\"非白名单可访问用户拦截\"}")
    @GetMapping("/queryUserInfoById")
    public UserInfo getUserInfo(@RequestParam("userId") String userId){
        logger.info("查询用户信息，userId:{}",userId);
        return new UserInfo("小K："+userId, 18, "北京市丰台区");
    }
}
